<script setup>
import { usePopStore } from '@/stores'
import { storeToRefs } from 'pinia'
const popStore = usePopStore()
const { Airspace } = storeToRefs(popStore)
const close = () => {
  Airspace.value.showPop = false
  __g.camera.set(537774.03, 2489244.6425, 6960.361875, -20.365765, -129.461258, 1)
}
</script>
<template>
  <transition
    appear
    name="custom-classes-transition"
    enter-active-class="animate__animated  animate__fadeIn"
    leave-active-class="animate__animated animate__faster  animate__fadeOut"
  >
    <div class="AirspacePop" ref="currentDom" v-if="Airspace.showPop">
      <p class="title">
        <span>空域属性信息</span>
        <span @click="close"><img src="@img/pop/close_icon.png" alt="" /></span>
      </p>
      <div class="content">
        <div class="left">
          <p class="name">{{ Airspace.popInfo.airspaceName }}</p>
          <p>
            <span>· 空域面积：</span><span>{{ Airspace.popInfo.airspaceArea }} km²</span>
          </p>
          <p>
            <span>· 空域底高：</span><span>{{ Airspace.popInfo.botHeight }} m</span>
          </p>
          <p>
            <span>· 空域顶高：</span><span>{{ Airspace.popInfo.topHeight }} m</span>
          </p>
          <p>
            <span>· 空域用途：</span><span>{{ Airspace.popInfo.airspaceType }}</span>
          </p>
        </div>
        <!-- <div class="right">
          <img src="@img/pop/airspaceimg.jpg" alt="" />
        </div> -->
      </div>
    </div>
  </transition>
</template>
<style scoped lang="scss">
.AirspacePop {
  position: fixed;
  z-index: 9;
  top: 200px;
  right: 600px;
  width: 328px;
  height: 219px;
  background: url('@img/pop/airspace_bg.png');
  background-size: 100% 100%;

  .title {
    display: flex;
    padding: 10px 20px 10px 50px;
    align-items: center;
    font-size: 16px;
    justify-content: space-between;

    span:last-child {
      width: 18px;
      height: 18px;
      cursor: pointer;

      img {
        width: 100%;
        height: 100%;
      }
    }
  }

  .content {
    margin-top: 5px;
    padding: 12px;
    display: flex;
    font-size: 13px;

    .left {
      flex: 1;

      p {
        padding: 5px 0;
        span:first-child {
          color: #afebff;
        }

        &.name {
          font-size: 14px;
        }
      }
    }

    .right {
      flex: 0 0 120px;
      margin-left: 5px;

      img {
        width: 100%;
      }
    }
  }
}
</style>
